<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" ValidateRequest ="false"
    EnableEventValidation="False" CodeFile="BillBoardMaintain.aspx.vb" Inherits="WFBillBoard" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:HiddenField ID="hiActualUID" runat="server" />
            <asp:HiddenField ID="hiDBName" runat="server" />
            <asp:HiddenField ID="hiUID" runat="server" />
            <asp:HiddenField ID="hiMode" runat="server" />
            <asp:ObjectDataSource ID="dsBillBoard" runat="server" TypeName="WorkFlow.BBL.WFBillBoardBBL"
                SelectMethod="GetDataUIDEdit" OldValuesParameterFormatString="original_{0}" InsertMethod="InsertBillBoard"
                UpdateMethod="UpdateBillBoard">
                <UpdateParameters>
                    <asp:ControlParameter ControlID="txtBillNo" Name="BillNo" PropertyName="Text" ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtSubject" Name="Subject" PropertyName="Text" Type="String"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtURL" Name="URL" PropertyName="Text" Type="String"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtTargetGroupID" Name="TargetGroupID" PropertyName="Text"
                        Type="String" ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="hiActualUID" Name="CrtUID" PropertyName="Value"
                        Type="String" ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtCrtGroupID" Name="CrtGroupID" PropertyName="Text"
                        Type="String" ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtBegDate" Name="BegDate" PropertyName="Text" Type="DateTime"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtEndDate" Name="EndDate" PropertyName="Text" Type="DateTime"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="cbActive" Name="Active" PropertyName="Checked" Type="Boolean"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtOrderBy" Name="OrderBy" PropertyName="Text" Type="String"
                        ConvertEmptyStringToNull="False" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="hiActualUID" Name="UID" PropertyName="Value" Type="String" />
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                </SelectParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="txtSubject" Name="Subject" PropertyName="Text" Type="String"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtURL" Name="URL" PropertyName="Text" Type="String"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtTargetGroupID" Name="TargetGroupID" PropertyName="Text"
                        Type="String" ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="hiActualUID" Name="CrtUID" PropertyName="Value"
                        Type="String" ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtCrtGroupID" Name="CrtGroupID" PropertyName="Text"
                        Type="String" ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtBegDate" Name="BegDate" PropertyName="Text" Type="DateTime"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtEndDate" Name="EndDate" PropertyName="Text" Type="DateTime"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="cbActive" Name="Active" PropertyName="Checked" Type="Boolean"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String"
                        ConvertEmptyStringToNull="False" />
                    <asp:ControlParameter ControlID="txtOrderBy" Name="OrderBy" PropertyName="Text" Type="String"
                        ConvertEmptyStringToNull="False" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <table width="1000px">
                <tr>
                    <td style="text-align: center">
                        <asp:Label ID="lblTitle" runat="server" SkinID="title" meta:resourcekey="lblTitle"></asp:Label>
                    </td>
                </tr>
                <tr style="vertical-align: text-top; width: 100%">
                    <td>
                        <br />
                        <table border="1" width="100%" id="tbInsert">
                            <tr style="width: 100%">
                                <td align="center" width="100%">
                                    <asp:LinkButton ID="btnInsert" runat="server" meta:resourcekey="btnInsert"></asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <TServerControl:TGridView ID="gvMain" runat="server" AllowHoverEffect="True" AllowHoverSelect="True"
                                        AllowPaging="True" DataKeyNames="BillNo" DataSourceID="dsBillBoard" ShowFooterWhenEmpty="False"
                                        ShowHeaderWhenEmpty="True" SkinID="pager" TotalRowCount="0" AutoGenerateColumns="False" PageSize ="5"
                                        Width="1000px">
                                        <EmptyDataTemplate>
                                            No Data
                                        </EmptyDataTemplate>
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:Button ID="btnEdit" runat="server" CommandName="Select" meta:resourcekey="btnEdit"
                                                        Text="Button" CommandArgument='<%# Bind("BillNo") %>' OnClick="btnEdit_Click" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="Subject" meta:resourcekey="colSubject" />
                                            <asp:BoundField DataField="URL" meta:resourcekey="colURL" />
                                            <asp:BoundField DataField="TargetGroupName" meta:resourcekey="colTargetGroupName" />
                                            <asp:BoundField DataField="CrtGroupName" meta:resourcekey="colCrtGroupName" />
                                            <asp:TemplateField meta:resourcekey="colActive">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="cbActive" runat="server" Checked="<%# Bind('Active') %>" Enabled="False" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="BegDate" DataFormatString="{0:yyyy/MM/dd HH:mm}" meta:resourcekey="colBegDate" />
                                            <asp:BoundField DataField="EndDate" DataFormatString="{0:yyyy/MM/dd HH:mm}" meta:resourcekey="colEndDate" />
                                            <asp:BoundField DataField="OrderBy" meta:resourcekey="colOrderBy" />
                                            <asp:BoundField DataField="CrtName" meta:resourcekey="colCrtName" />
                                            <asp:BoundField DataField="CrtDate" DataFormatString="{0:yyyy/MM/dd}" meta:resourcekey="colCrtDate" />
                                            <asp:BoundField DataField="ModiName" meta:resourcekey="colModiName" />
                                            <asp:BoundField DataField="ModiDate" DataFormatString="{0:yyyy/MM/dd}" meta:resourcekey="colModiDate" />
                                        </Columns>
                                    </TServerControl:TGridView>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Panel ID="plInsert" runat="server" BackColor="#E7FEC2" Width="800px" Height="500px">
                            <table>
                                <tr style="text-align: center">
                                    <td colspan="2">
                                        <asp:LinkButton ID="btnSave" runat="server" meta:resourcekey="btnSave"></asp:LinkButton>
                                        <asp:LinkButton ID="btnClose" runat="server" meta:resourcekey="btnClose"></asp:LinkButton>
                                    </td>
                                </tr>
                                <tr style="text-align: center">
                                    <td colspan="2">
                                        <asp:Label ID="lbMode" runat="server" Font-Bold="true" ForeColor="Red" Font-Size="14px"></asp:Label>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblBillNo" runat="server" meta:resourcekey="lblBillNo" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtBillNo" runat="server" ReadOnly="true" BackColor="Gray" ForeColor ="White"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblSubject" runat="server" meta:resourcekey="lblSubject" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtSubject" runat="server" Width="600px" Height="112px" 
                                            TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblURL" runat="server" meta:resourcekey="lblURL" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtURL" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblTargetGroupName" runat="server" meta:resourcekey="lblTargetGroupName"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTargetGroupID" runat="server" Width="60px"></asp:TextBox>
                                        <asp:LinkButton ID="btnTargetGroupID" runat="server" Style="height: 21px">...</asp:LinkButton>
                                        <asp:TextBox ID="lblTargetGroupName1" runat="server" BackColor="Gray" Width="200px" ForeColor ="White"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblCrtGroupID" runat="server" meta:resourcekey="lblCrtGroupID"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCrtGroupID" runat="server" Width="60px"></asp:TextBox>
                                        <asp:LinkButton ID="btnCrtGroupID" runat="server" Style="width: 16px">...</asp:LinkButton>
                                        <asp:TextBox ID="txtCrtGroupName" runat="server" BackColor="Gray" Width="200px"  ForeColor ="White"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblBegDate" runat="server" meta:resourcekey="lblBegDate"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtBegDate" runat="server" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblEndDate" runat="server" meta:resourcekey="lblEndDate"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtEndDate" runat="server" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblStatus" runat="server" meta:resourcekey="lblStatus" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="cbActive" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblOrderBy" runat="server" meta:resourcekey="lblOrderBy" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtOrderBy" runat="server" Width="200px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblCrtDate" runat="server" meta:resourcekey="lblCrtDate" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblCrtDate2" runat="server" meta:resourcekey="lblCrtDate"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblCrtName" runat="server" meta:resourcekey="lblCrtName" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblCrtUID" runat="server"></asp:Label>
                                        <asp:Label ID="lblCrtName2" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblModiName" runat="server" meta:resourcekey="lblModiName" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblModiUID" runat="server"></asp:Label>
                                        <asp:Label ID="lblModiName2" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <asp:Label ID="lblModiDate" runat="server" meta:resourcekey="lblModiDate" Width="80px"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblModiDate2" runat="server"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
            <asp:LinkButton ID="btnInsert1" runat="server" Style="display: none">Ins</asp:LinkButton>
            <ajaxToolkit:ModalPopupExtender ID="mpInsert" runat="server" TargetControlID="btnInsert1"
                CancelControlID="btnClose" PopupControlID="plInsert" PopupDragHandleControlID="plInsert">
            </ajaxToolkit:ModalPopupExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
